var path = require("path");
var isDev = process.env.NODE_ENV === "development";

function resolve(dir) {
  console.log(__dirname);
  return path.join(__dirname, dir);
}

let publicPath = isDev ? "/" : "/static/service/";
let outputDir = "../www/static/service/";
let indexPath = "../../../view/index_index.html";

module.exports = {
  productionSourceMap: isDev,
  publicPath,
  outputDir,
  indexPath,
  lintOnSave: true,
  chainWebpack: (config) => {
    config.resolve.alias.set("@", resolve("src")); // 设置别名 @ 等于src
  },
  devServer: {
    publicPath,
    proxy: {
      "/": {
        target: "http://192.168.0.119:8999/",
        changeorigin: true,
        pathrewrite: { "^/": "/" },
      },
    },
  },
};
